The present invention relates to a distortion detecting device, a distortion correcting device, and a distortion correcting method for detecting the generated distortion accompanying the linearity error (conversion error) of an analog/digital converter when an analog audio signal is converted to a digital audio signal through analog-digital conversion by the analog/digital converter.
Heretofore, analog/digital converters (A/D converters) contained linearity error in accordance with the A/D conversion precision. When the A/D converter converts an analog signal to a digital signal, distortion is generated accompanying the linearity error (hereinafter referred to as xe2x80x9cconversion errorxe2x80x9d) of the A/D converter in the converted digital audio signal. In this case, when performing A/D conversion with the A/D converter, it is possible to reduce to a certain degree the distortion based on the conversion error at the time of A/D conversion by adjusting the internal resistance of the A/D converter or adjusting the bit weighting with an external circuit.
However, a great number of music software titles, which were digitally recorded in the past using A/D conversion (digital audio signals recorded in the past), were converted from analog to digital by A/D converters having poor conversion precision at a low number of bits (such as 13 bits or 14 bits). Consequently, the A/D converters themselves contained conversion errors even if adjusted (and contained considerable distortion based on the conversion error compared to modern (such as 16-bit) A/D converters) and the distortion accompanying the conversion error due to poor conversion precision becomes one cause of degraded quality of the recorded music signal. Therefore, it is presently preferable to obtain digital audio signals having reduced distortion based on the conversion error of the A/D converters that were used in the past at the time of the recording.
In this case, it is possible to measure the characteristics of the A/D converters that were used in the past at the time of the recording and to correct the A/D conversion error based on these characteristics. However, since the characteristics of A/D converters deteriorate with time, the characteristics at the time of A/D conversion, namely, the conversion error, cannot be detected accurately from the A/D converters that were used at the time of the A/D conversion. Furthermore, 13-bit or 14-bit A/D converters that were used at the time of recording generally do not presently exist. In this case, the characteristics of the A/D converters cannot be detected from the A/D converters. It is thus difficult to accurately detect the A/D conversion error of the digital audio signals regardless of whether or not the 13-bit or 14-bit A/D converters that were used in the past at the time of the recording are currently available, and resulted in a problem where the A/D conversion error could not be reduced.
It was also difficult to estimate (detect) the conversion error at the time of A/D conversion from the digital audio signal that was recorded with distortion based on the conversion error (pre-recorded music signal). A known measurement device using a sine wave histogram method estimates (detects) the conversion error of the A/D conversion from the digital audio signal. After a distortion-free sine wave is fed to an A/D converter to be measured, a histogram is obtained and the measurement device uses the histogram to measure the conversion error that is to be measured. However, if the signal source, such as a digital audio signal, is not a sine wave, the conversion error could not be estimated (detected).
In this manner, it was difficult hitherto to estimate (detect) the conversion error at the time A/D conversion from the digital audio signal (music signal), which was already recorded using A/D conversion, and therefore, a digital audio signal with reduced distortion based on the conversion error at the time of A/D conversion could not be obtained.
It is therefore an object of the present invention to provide a distortion detecting device, a distortion correcting device, and a distortion correcting method for making it possible to correct the digital audio signal so as to reduce the distortion included in the digital audio signal by estimating (detecting) the distortion based on the linearity error of the A/D converter at the time of A/D conversion from the digital audio signal (pre-recorded music signal) that was converted from analog to digital by the A/D converter having linearity error.
The distortion detecting device for digital audio signal relating to the present invention comprises storage means for storing a digital audio signal, occurrence frequency detecting means for extracting a plurality of samples from the digital audio signal stored in the storage means and counting the occurrence frequency of the sample for every code expressing a quantization level of the sample, normalizing means for extracting a distortion characteristic accompanying the linearity error of an analog/digital converter as a normalized occurrence frequency from the occurrence frequency for every code detected by the occurrence frequency detecting means, and error bit detecting means for detecting an error bit from a difference between codes of the normalized occurrence frequency extracted by the normalizing means.
According to the present invention, even though the analog/digital converter that generated the digital audio signal including conversion error does not exist, the distortion based on the linearity error of the analog/digital converter can be detected on the basis of the generated digital audio signal.
The distortion correcting device for digital audio signal relating to the present invention comprises conversion error detecting means for detecting the error bit influenced by the linearity error of the analog/digital converter from the occurrence frequency for every code of the digital audio signal converted to code by the analog/digital converter, and conversion error correcting means for correcting the error bit of the digital audio signal based on a detection result from the conversion error detecting means.
According to the present invention, the bit at which the distortion accompanying the linearity error of the analog/digital converter is generated is detected, and based on this detection result, the bit concerning the distortion is corrected so that the distortion of the digital audio signal generated including conversion error can be reduced.
In the distortion correcting device for digital audio signal relating to the present invention, the conversion error detecting means comprise the storage means for storing the digital audio signal, the occurrence frequency detecting means for extracting a plurality of samples from the digital audio signal stored in the storage means and counting the occurrence frequency of the sample for every code expressing a quantization level of the sample, the normalizing means for extracting the distortion characteristic accompanying the linearity error of the analog/digital converter as normalized occurrence frequency from the occurrence frequency for every code detected by the occurrence frequency detecting means, and the error bit detecting means for detecting the error bit based on the code corresponding to a feature of the normalized occurrence frequency.
According to the present invention, the normalization of the occurrence frequency causes the feature dependent on the digital audio signal for which samples were collected to be removed and the conversion characteristic of the analog/digital converter at the time of generating the digital audio signal to be extracted. Thus, the distortion correcting device according to the present invention can correct an arbitrary digital audio signal generated with the same conversion characteristic as the analog/digital converter.
In the distortion correcting device for digital audio signal relating to the present invention, the occurrence frequency detecting means comprise a histogram memory using as an address the code according to the quantization level, read data in the histogram memory at the address corresponding to the code of the sample read from the storage means and add 1, write added data to the histogram memory, and create a histogram expressing the occurrence frequency for every code.
In the distortion correcting device for digital audio signal relating to the present invention, the normalizing means obtain an average occurrence frequency, which averages the occurrence frequency for every block formed from a plurality of codes respectively corresponding to a plurality of adjacent quantization levels, divide the occurrence frequency corresponding to every code by the average occurrence frequency of the block including the concerned codes, and set a value of the division result as the normalized occurrence frequency.
In the distortion correcting device for digital audio signal relating to the present invention, the error bit detecting means obtain an interval of the quantization level according to a varying pattern of the normalized occurrence frequency appearing in correspondence to the quantization level series, and detect the error bit according to the concerned interval.
In the distortion correcting device for digital audio signal relating to the present invention, the conversion error correcting means estimate the correct code on the basis of the error bit detected by the conversion error detecting means, and replace the code of the digital audio signal that was input with an estimate of the correct code.
In the distortion correcting device for digital audio signal relating to the present invention, the estimation of the correct code in the conversion error correcting means is performed by setting to X the average of the normalized occurrence frequency corresponding to every code having the error bit, obtaining a first difference D1, when the same value of the digital audio signal continues in a plurality of Kt samples from time K1 to Kt, between the first sample value of the same value in succession and the value of the preceding sample, obtaining a second difference D2 between the last sample value of the same value in succession and the value of the succeeding sample, and adding 1 to values from Kt/X to Kt of the plurality of samples when the first difference D1 and second difference D2 are positive values or adding 1 to values from K1 to Kt(1-1/X) of the plurality of samples when the first difference D1 and second difference D2 are negative values.
The distortion correcting device for digital audio signal relating to the present invention comprise the storage means for storing the digital audio signal converted to code by the analog/digital converter, the occurrence frequency detecting means for extracting a plurality of samples from the digital audio signal stored in the storage means and counting the occurrence frequency of the samples for every code expressing the quantization level of the samples to obtain a level distribution, the normalizing means for generating, by applying a low-pass filtering process on the original level distribution detected by the occurrence frequency detecting means, an ideal level distribution approximating an ideal case where the analog/digital converter has no error, dividing the original level distribution by the ideal level distribution, and setting the divided result thereof as a normalized level distribution, the conversion table calculating means for calculating a conversion table for all of the quantization levels of the digital audio signal based on the normalized level distribution, and the data substituting means for substituting the quantization level of the digital audio signal with the level data according to the conversion table for output.
According to the present invention, the conversion error of the analog/digital converter is estimated from the level distribution of the digital audio signal recorded using the analog/digital converter that is used, the conversion table for all of the quantization levels of the digital audio signal; and is calculated based on the estimated conversion error, the conversion process is performed on the digital audio signal using the table, and the distortion generated due to the conversion error of the analog/digital converter is corrected so that the unevenness in the occurrence frequency is corrected at or below the threshold and the A/D conversion error can be substantially reduced.
The distortion correcting method for digital audio signal relating to the present invention corrects the distortion generated due to the conversion error of the analog/digital converter by estimating the conversion error of the analog digital converter that is used, from the level distribution of the digital audio signal recorded using the analog/digital converter, calculating the conversion table for all of the quantization levels of the digital audio signal based on the estimated conversion error, and performing a conversion process using the conversion table on the digital audio signal.
In the distortion correcting method for digital audio signal relating to the present invention, the conversion table is created by collecting a predetermined number of samples from the digital audio signal recorded using the analog/digital converter to obtain the level distribution of the concerned samples, applying the low-pass filtering process on the level distribution to generate an ideal level distribution approximating an ideal case where the analog/digital converter has no error, dividing the level distribution, before the low-pass filtering process was applied, by the ideal level distribution, to set the divided result thereof as a normalized level distribution, carrying out accumulation based on the normalized level distribution to calculate a conversion table for all of said quantization levels of die digital audio signal, and substituting the quantization level of the digital audio signal with level data according to the conversion table for output.
According to the above-mentioned present invention, the error of the analog/digital converter can be detected from the recorded digital audio signal even though the characteristic of the analog/digital converter used in the generation of the digital audio signal is unknown or the analog/digital converter itself is unavailable, and furthermore, the distortion of the digital audio signal can be corrected on the basis of the error of detected analog/digital converter and the distortion of the digital audio signal can be reduced to improve the audio quality.
On the other hand, in another distortion correcting method for the digital audio signal relating to the present invention, a linear count-up signal is input to the analog/digital converter, the conversion error of the analog/digital converter is calculated by comparing the input signal of the analog/digital converter with the output signal thereof, and on the basis of the above calculated conversion error, the distortion based on the conversion error included in an arbitrary output signal from the analog/digital converter is corrected according to the conversion error calculated in the above-mentioned manner.
According to the present invention, if the A/D converter used when recording the music source presently exists without changes in its conversion characteristics, a music signal currently recorded in 16 bits, for example, can be converted in the future into a music signal having 24 bits or more.